<!-- 学生信息详情弹窗 -->
<template>
  <a-form
    ref="form3"
    class="ele-form-detail"
    :model="staffAttendanceRecordsModalApp.staffAttendanceRecords"
    :label-col="{md: {span: 2}, sm: {span: 4}, xs: {span: 6}}"
    :wrapper-col="{md: {span: 22}, sm: {span: 20}, xs: {span: 18}}">
    <a-descriptions :title="staffAttendanceRecordsModalApp.title" bordered>
<!--      <a-descriptions-item label="标识">-->
<!--        {{ staffAttendanceRecordsModalApp.staffAttendanceRecords.Eid }}-->
<!--      </a-descriptions-item>-->
      <a-descriptions-item label="创建人">
        {{ staffAttendanceRecordsModalApp.staffAttendanceRecords.creatorName }}
      </a-descriptions-item>
<!--      <a-descriptions-item label="名称">-->
<!--        {{ staffAttendanceRecordsModalApp.staffAttendanceRecords.name }}-->
<!--      </a-descriptions-item>-->
      <a-descriptions-item label="员工">
        {{ staffAttendanceRecordsModalApp.staffAttendanceRecords.staffName }}
      </a-descriptions-item>
<!--      <a-descriptions-item label="状态">-->
<!--        {{ staffAttendanceRecordsModalApp.staffAttendanceRecords.status }}-->
<!--      </a-descriptions-item>-->
      <a-descriptions-item label="出勤时间">
        {{ staffAttendanceRecordsModalApp.staffAttendanceRecords.date }}
      </a-descriptions-item>
<!--      <a-descriptions-item label="创建人ID">-->
<!--        {{ staffAttendanceRecordsModalApp.staffAttendanceRecords.creatorId }}-->
<!--      </a-descriptions-item>-->
      <a-descriptions-item label="备注">
        {{ staffAttendanceRecordsModalApp.staffAttendanceRecords.remark }}
      </a-descriptions-item>
<!--      <a-descriptions-item label="创建时间">-->
<!--        {{ staffAttendanceRecordsModalApp.staffAttendanceRecords.createDatetime }}-->
<!--      </a-descriptions-item>-->
    </a-descriptions>
  </a-form>
</template>

<script>
import {defineComponent, reactive, onMounted, inject} from "vue";
import {useRoute} from "vue-router"
import {StaffAttendanceRecordsService} from "@/views/restaurant/staff/staffAttendanceRecords/staffAttendanceRecordsService";

export default defineComponent({
  setup() {
    const route = useRoute();
    let routeId = route.params.id;
    let staffAttendanceRecordsListApp = inject('staffAttendanceRecordsListApp', reactive({}));
    const staffAttendanceRecordsModalApp = reactive({id: null, staffAttendanceRecords: {}, display: false});

    onMounted(() => {
      staffAttendanceRecordsModalApp.staffAttendanceRecords = {};
      if (routeId) {
        staffAttendanceRecordsModalApp.id = routeId;
      } else if (staffAttendanceRecordsListApp.viewModalShowing) {
        staffAttendanceRecordsModalApp.id = staffAttendanceRecordsListApp.currentId;
        staffAttendanceRecordsModalApp.display = true;
      }
      if (staffAttendanceRecordsModalApp.id) {
        getInfo(staffAttendanceRecordsModalApp.id);
      }
    })

    const getInfo = (id) => {
      StaffAttendanceRecordsService.findStaffAttendanceRecordsForView( id).then((res) => {
        staffAttendanceRecordsModalApp.staffAttendanceRecords = res.data;
        // staffAttendanceRecordsModalApp.title = "查看 " + staffAttendanceRecordsModalApp.staffAttendanceRecords.name;
      })
    }

    return {
      staffAttendanceRecordsModalApp,
      routeId,
      getInfo,
    }
  }
})
</script>

<style scoped>
</style>

